<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="jakarta.tags.core" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<html>
<head>
  <base href="${ctx} /">
    <title>Title</title>
    <link rel="stylesheet" href="assets/modules/movie/css/list.css">
    <link rel="stylesheet" href="assets/lib/layui/css/layui.css">
    <script src="assets/lib/jquery/jquery-3.4.1.js"></script>
    <script src="assets/lib/layui/layui.js"></script>
  <script>
    const ctx="${ctx}"
    let currentPage=1; //当前页数
    let pages=0; //总页数
    let totalAll=0;
    let params={
      "name":'',
      "startTime":'',
      "endTime":'',
      "actor":'',
      "rating":'',
      "movieTime":'',
      "order":''
    }
  </script>
  <script src="assets/modules/movie/js/list.js"></script>
</head>
<body>
<div class="search">
  <form action="" id="search-form">
    <div>
      <label for="name">电影名称:</label>
      <input id="name" type="text" name="name" >
    </div>
    <div>
      <label for="actor">主演:</label>
      <input id="actor" type="text" name="actor" >
    </div>

    <div class="layui-form-item">
      <label>上映日期：</label>
      <div class="layui-inline" id="range_date">
        <div class="layui-input-inline">
          <input type="text" autocomplete="off" id="laydate-start-date" class="layui-input"
                 placeholder="开始日期">
        </div>
        <div class="layui-form-mid">-</div>
        <div class="layui-input-inline">
          <input type="text" autocomplete="off" id="laydate-end-date" class="layui-input"
                 placeholder="结束日期">
        </div>
      </div>
    </div>
    <div>
      <label for="rating">评分:</label>
      <input id="rating" type="text" name="rating" >
    </div>
    <div>
      <label for="movieTime">电影时长:</label>
      <input id="movieTime" type="text" name="movieTime" >
    </div>
  </form>
</div>
<div class="action">
  <button type="button" id="add">新增</button>
  <button type="button" id="edit">修改</button>
  <button type="button" id="search">查询</button>
  <button type="button" id="reset">重置</button>
  <button type="button" id="del">删除</button>
  <button type="button" id="desc">按照票房降序</button>
  <button type="button" id="asc">按照票房升序</button>
</div>

  <table id="tbl">
    <thead>
    <tr>
      <th>
        <input type="checkbox" id="check-all">
      </th>
      <th> ID</th>
      <th>电影名</th>
      <th>主演</th>
      <th>上映时间</th>
      <th>时长(分钟)</th>
      <th>评分</th>
      <th>票房(万)</th>
    </tr>
    </thead>
    <tbody>
      <c:forEach items="${movieList}" var="m">
        <tr>
          <td>${m.id}</td>
          <td>${m.name}</td>
          <td>${m.actor}</td>
          <td>${m.dateTime}</td>
          <td>${m.movieTime}</td>
          <td>${m.rating}</td>
          <td>${m.money}</td>
        </tr>
      </c:forEach>
    </tbody>
  </table>
  <div class="paginate">
    <ul>
      <li class="first"><a href="#">首页</a></li>
      <li class="prev"><a href="#">上一页</a></li>
      <li class="next"><a href="#">下一页</a></li>
      <li class="last"><a href="#">尾页</a></li>
    </ul>
  </div>
<div id="page-info-one">
        <span id="page-info">
    一共查询到<span id="total-all">0</span>条数据，一共<span id="total-pages">0</span>页
    </span>
  <span id="money-sum">
    当前票房总计<span id="total-money">0</span>万元
   </span>

</div>

</body>
</html>
